CentOS 7
Sponsored Link

OpenStack Queens : How to use Ceilometer(Glance)
2018/03/11
 
This is how to use OpenStack Telemetry Service (Ceilometer) for Glance service.
This example is based on the emvironment like follows.
     ------------+---------------------------+---------------------------+------------
                 |                           |                           |
             eth0|10.0.0.30              eth0|10.0.0.50              eth0|10.0.0.51
     +-----------+-----------+   +-----------+-----------+   +-----------+-----------+
     |    [ Control Node ]   |   |    [ Storage Node ]   |   |    [ Compute Node ]   |
     |                       |   |                       |   |                       |
     |  MariaDB    RabbitMQ  |   |      Open_vSwitch     |   |        Libvirt        |
     |  Memcached  httpd     |   |        L2_Agent       |   |     Nova_Compute      |
     |  Keystone   Glance    |   |        L3_Agent       |   |      Open_vSwitch     |
     |  Nova_API  Cinder_API |   |     Metadata_Agent    |   |        L2_Agent       |
     |  Neutron_Server       |   |     Cinder_Volume     |   |  Ceilometer_Compute   |
     |  Metadata_Agent       |   |        Heat_API       |   |                       |
     |  Gnocchi              |   |      Heat Engine      |   |                       |
     |  Ceilometer_Central   |   |                       |   |                       |
     +-----------------------+   +-----------------------+   +-----------------------+

[1] Change settings for Glance service to enable Telemetry data collention like follows.
[root@dlp ~(keystone)]#
vi /etc/glance/glance-api.conf
# add to the end

[oslo_messaging_notifications]
driver = messagingv2
# RabbitMQ connection info
transport_url = rabbit://openstack:password@10.0.0.30
[root@dlp ~(keystone)]#
vi /etc/glance/glance-registry.conf
# add to the end

[oslo_messaging_notifications]
driver = messagingv2
# RabbitMQ connection info
transport_url = rabbit://openstack:password@10.0.0.30
[root@dlp ~(keystone)]#
systemctl restart openstack-glance-api openstack-glance-registry

[2] It's some example to display metrics and meters.
# list resources

[root@dlp ~(keystone)]#
openstack metric resource list

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| 70846728-419e-47bf-8b25-829d12edfca6 | instance                   | 52e02649325e4cf1b903d00cadb8f... 
| 6edf4961-70e0-52f0-8723-6ed18d96776a | instance_disk              | 52e02649325e4cf1b903d00cadb8f... 
| 6b2e6172-3c58-59d6-ac72-0c79ae0ce313 | instance_network_interface | 52e02649325e4cf1b903d00cadb8f... 
+--------------------------------------+----------------------------+----------------------------------

# test to add an image

[root@dlp ~(keystone)]#
openstack image create "CentOS74" --file centos74.qcow2 --disk-format qcow2 --container-format bare --public

# test to download an image

[root@dlp ~(keystone)]#
openstack image save --file centos7.qcow2 CentOS74

# list resources

[root@dlp ~(keystone)]#
openstack metric resource list

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| 70846728-419e-47bf-8b25-829d12edfca6 | instance                   | 52e02649325e4cf1b903d00cadb8f... 
| 6edf4961-70e0-52f0-8723-6ed18d96776a | instance_disk              | 52e02649325e4cf1b903d00cadb8f... 
| 6b2e6172-3c58-59d6-ac72-0c79ae0ce313 | instance_network_interface | 52e02649325e4cf1b903d00cadb8f... 
| fcb4860b-c333-4169-9478-c05e86a9c594 | image                      | 2551ca222ff54fac984a914e5beb4... 
+--------------------------------------+----------------------------+----------------------------------

# details of the resource

[root@dlp ~(keystone)]#
openstack metric resource show fcb4860b-c333-4169-9478-c05e86a9c594

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | b1da1070c8af427886d0202f8bbe414f                                  |
| created_by_user_id    | 61d8449da0b345f2aecfaf0d13310bd7                                  |
| creator               | 61d8449da0b345f2aecfaf0d13310bd7:b1da1070c8af427886d0202f8bbe414f |
| ended_at              | None                                                              |
| id                    | fcb4860b-c333-4169-9478-c05e86a9c594                              |
| metrics               | image.download: 908e9867-efeb-48b7-8eb0-8714f50e135b              |
|                       | image.serve: f5860912-73f7-4abb-844c-e315b812250a                 |
|                       | image.size: 1391eb15-909a-4532-948f-50d82b1044c6                  |
| original_resource_id  | fcb4860b-c333-4169-9478-c05e86a9c594                              |
| project_id            | 2551ca222ff54fac984a914e5beb40d1                                  |
| revision_end          | None                                                              |
| revision_start        | 2018-03-12T07:49:42.083251+00:00                                  |
| started_at            | 2018-03-12T07:49:42.083209+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image download

[root@dlp ~(keystone)]#
openstack metric measures show 908e9867-efeb-48b7-8eb0-8714f50e135b

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2018-03-12T16:50:00+09:00 |       300.0 | 1324154880.0 |
+---------------------------+-------------+--------------+

# display image size

[root@dlp ~(keystone)]#
openstack metric measures show 1391eb15-909a-4532-948f-50d82b1044c6

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2018-03-12T16:45:00+09:00 |       300.0 | 1324154880.0 |
+---------------------------+-------------+--------------+
 
Tweet